package com.itheima.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author itheima
 * @Date 2022/5/2 9:47
 * 需求：写一个url能够供浏览器访问(http://localhost:8080/hello/robin)，返回数据：hello,robin
 */
@RestController
public class HelloController {

    //http://localhost:8080/hello/robin,返回数据："hello,robin"
    @GetMapping("/hello/{name}")
    public String sayHello(@PathVariable String name) {
        return "hello," + name;
    }
}
